<?php

class SendMailService {

	static public function emailUrl($url) {
		return  'http://'.$_SERVER['SERVER_NAME'].$url;
	}
	/**
	 * 发送邮件
	 * Enter description here ...
	 */
	static public function sendMail($content,$title,$address) {

		$mModel = Mailer::model()->find();
		# 设置
		Yii::app()->mailer->From = $mModel->username;
		Yii::app()->mailer->host = $mModel->host;
		Yii::app()->mailer->username = $mModel->username;
		Yii::app()->mailer->password = $mModel->password;

		Yii::app()->mailer->AddAddress($address);
		Yii::app()->mailer->Subject = $title;
		Yii::app()->mailer->MsgHTML($content);
		Yii::app()->mailer->Send();
		return true;
	}
}

?>